//** This is an example of auto injecting a DLL from the GWCA.NET Demo
private void Form1_Load(object sender, EventArgs e)
{
	//** Check if GW is running.
	if (Gw.GetGwProcessHandle() == IntPtr.Zero)
	{
		MessageBox.Show("GWCA.NET could not locate a running instance of Guild Wars.\r\nApplication will not function properly until Guild Wars is running.", "GWCA.NET Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
	}
	else
	{
		int GuildWarsBuild = Gw.CmdCb(Ca.GetBuildNumber)[0];
		if (GuildWarsBuild == 0)
		{
			switch (MessageBox.Show("We have detected that Guild Wars is running, but that GWCA has not been detected.  Would you like us to inject it for you from:\r\n " + System.IO.Directory.GetCurrentDirectory() + "\\Graphics.dll?", "GWCA.NET Injection", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
			{
				case (DialogResult.Yes):
					using (MemoryAccess Ma = new MemoryAccess(Gw.GetGwProcessId()))
					{
						if (Ma.InjectLibrary() == true)
						{
							MessageBox.Show("GWCA has been injected successfully!", "GWCA.NET Injection", MessageBoxButtons.OK, MessageBoxIcon.Information);
						}
						else
						{
							MessageBox.Show("GWCA injection has failed.", "GWCA.NET Injection", MessageBoxButtons.OK, MessageBoxIcon.Warning);
						}
					}
					break;
				case (DialogResult.No):
					MessageBox.Show("You have chosen NOT to inject GWCA to Guild Wars.  This programs functionality will be limited.", "GWCA.NET Injection", MessageBoxButtons.OK, MessageBoxIcon.Information);
					break;
			}
		}
	}